home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / System / ThreadLib 1.0d1 / Source / ThreadUtil / ThreadUtil.h < prev   
Encoding:
C/C++ Source or Header  |  1994-02-10  |  1.2 KB  |  57 lines  |  [TEXT/KAHL]

  1. #pragma once
  2.  
  3. #if ! WINTER_SHELL
  4.  
  5. #include <stddef.h>
  6. #define volatile
  7.  
  8. /* assertions */
  9. #ifndef NDEBUG
  10.     #define myassert(x)    ((void) ((x) || assertfailed()))
  11. #else
  12.     #define myassert(x) ((void) 0)
  13. #endif
  14. #define require(x)    myassert(x)
  15. #define check(x)    myassert(x)
  16. #define ensure(x)    myassert(x)
  17. int assertfailed(void);
  18.  
  19. /* types */
  20. typedef unsigned long TicksType;
  21. typedef char CStr255[sizeof(Str255)];
  22.  
  23. /* memory operations */
  24. void *memclr(void *p, size_t n);
  25. Boolean HandleValid(void *h);
  26. Boolean HandleValidSize(void *h, size_t n);
  27. void *HandleBeginClear(size_t n);
  28. void HandleEnd(void *h);
  29. Boolean PtrValid(void *p);
  30. size_t PtrSize(void *p);
  31. void *PtrBegin(size_t n);
  32. void PtrEnd(void *p);
  33.  
  34. /* low-memory globals */
  35. Ptr GetCurStackBase(void);
  36. void SetStkLowPt(Ptr p);
  37.  
  38. /* linked list stuff */
  39.  
  40. typedef union LLUnion LLType, *LLPtr, **LLHandle;
  41.  
  42. union LLUnion {
  43.     LLPtr pnext;
  44.     LLHandle hnext;
  45. };
  46.  
  47. /* void pointer so we don't have to worry about type casting in function calls */
  48. typedef void *LLObjectType;
  49.  
  50. /* linked list operations */
  51. Boolean LLHValid(LLObjectType item);
  52. LLObjectType LLHNext(LLObjectType item);
  53. LLObjectType LLHAppend(LLObjectType head, LLObjectType item);
  54. LLObjectType LLHDelete(LLObjectType head, LLObjectType item);
  55.  
  56. #endif /* WINTER_SHELL */
  57.